using System;
using System.ComponentModel;

using DevExpress.Xpo;
using DevExpress.Data.Filtering;

using DevExpress.ExpressApp;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Persistent.Validation;

namespace Positive.Module.Common.Location
{
    [DefaultClassOptions]
    public class Language : BaseObject
    {
        public Language(Session session)
            : base(session)
        {
            // This constructor is used when an object is loaded from a persistent storage.
            // Do not place any code here or place it only when the IsLoading property is false:
            // if (!IsLoading){
            //    It is now OK to place your initialization code here.
            // }
            // or as an alternative, move your initialization code into the AfterConstruction method.
        }
        public override void AfterConstruction()
        {
            base.AfterConstruction();
            // Place here your initialization code.

            this._isActive = true;
            this._isDefault = false;

        }
        private string _name;
        private string _tag;
        private string _code;
        private string _cultureCode;
        private Country _country;
        private bool _isActive;
        private bool _isDefault;

        public string Name
        {
            get { return _name; }
            set { SetPropertyValue("Name", ref _name, value); }
        }


        public string Tag
        {
            get { return _tag; }
            set { SetPropertyValue("Tag", ref _tag, value); }

        }

        public string Code
        {
            get { return _code; }
            set { SetPropertyValue("Code", ref _code, value); }

        }
        public string CultureCode
        {
            get { return _cultureCode; }
            set { SetPropertyValue("CultureCode", ref _cultureCode, value); }
        }


        public bool IsActive
        {
            get { return _isActive; }
            set { SetPropertyValue("IsActive", ref _isActive, value); }
        }


        public bool IsDefault
        {
            get { return _isDefault; }
            set { SetPropertyValue("IsDefault", ref _isDefault, value); }
        }

        [Association("Country-Language")]
        public Country Country
        {
            get { return _country; }
            set { SetPropertyValue("Country", ref _country, value); }
        }
    }
    }


